Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for "satisfies" keyword in test code. #155

Merged
merged 2 commits into from
May 18, 2023

Conversation

tri-star
Copy link
Contributor

@tri-star tri-star commented May 6, 2023

Overview

Test Explorer fails to build the tree if the "satisfies" keyword is included in the test code.
This may be because the use of "satisfies" requires TypeScript 4.9 or later.
(The message "parse error" is logged.)

image

example test code:

import { describe, expect } from 'vitest'

type Person = {
  name: string
  age: number
}

describe('test', () => {
  const person = {
    name: 'John',
    age: 20,
  } satisfies Person
  expect(person.name).toBe('John')
})

Changes

…t files.

also update related packages(babel/parser, babel/types, types/node)
@stackblitz
Copy link

stackblitz bot commented May 6, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@zxch3n zxch3n merged commit a7d48d9 into vitest-dev:main May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants